<!doctype html>
<meta charset="utf8">

<emu-clause id="sec-temporal-plainyearmonth-objects">
  <h1>Temporal.PlainYearMonth Objects</h1>
  <p>A Temporal.PlainYearMonth object is an Object that contains Number values corresponding to a particular year and month.</p>

  <emu-clause id="sec-temporal-plainyearmonth-constructor">
    <h1>The Temporal.PlainYearMonth Constructor</h1>
    <p>The Temporal.PlainYearMonth constructor:</p>
    <ul>
      <li>
        creates and initializes a new Temporal.PlainYearMonth object when called as a constructor.
      </li>
      <li>
        is not intended to be called as a function and will throw an exception when called in that manner.
      </li>
      <li>
        may be used as the value of an `extends` clause of a class definition.
        Subclass constructors that intend to inherit the specified Temporal.PlainYearMonth behaviour must
        include a super call to the %Temporal.PlainYearMonth% constructor to create and initialize subclass
        instances with the necessary internal slots.
      </li>
    </ul>

    <emu-clause id="sec-temporal.plainyearmonth">
      <h1>Temporal.PlainYearMonth ( _isoYear_, _isoMonth_ [ , _calendarLike_ [ , _referenceISODay_ ] ] )</h1>
      <p>
        When the `Temporal.PlainYearMonth` function is called, the following steps are taken:
      </p>
      <emu-alg>
        1. If NewTarget is *undefined*, then
          1. Throw a *TypeError* exception.
        1. If _referenceISODay_ is *undefined*, then
          1. Set _referenceISODay_ to *1*<sub>𝔽</sub>.
        1. Let _y_ be ? ToIntegerOrInfinity(_isoYear_).
        1. If _y_ is +∞ or -∞, throw a *RangeError* exception.
        1. Let _m_ be ? ToIntegerOrInfinity(_isoMonth_).
        1. If _m_ is +∞ or -∞, throw a *RangeError* exception.
        1. Let _calendar_ be ? ToTemporalCalendarWithISODefault(_calendarLike_).
        1. Let _ref_ be ? ToIntegerOrInfinity(_referenceISODay_).
        1. If _ref_ is +∞ or -∞, throw a *RangeError* exception.
        1. Return ? CreateTemporalYearMonth(_y_, _m_, _calendar_, _ref_, NewTarget).
      </emu-alg>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-properties-of-the-temporal-plainyearmonth-constructor">
    <h1>Properties of the Temporal.PlainYearMonth Constructor</h1>
    <p>The value of the [[Prototype]] internal slot of the Temporal.PlainYearMonth constructor is the intrinsic object %Function.prototype%.</p>
    <p>The Temporal.PlainYearMonth constructor has the following properties:</p>

    <emu-clause id="sec-temporal-plainyearmonth-prototype">
      <h1>Temporal.PlainYearMonth.prototype</h1>
      <p>The initial value of `Temporal.PlainYearMonth.prototype` is %Temporal.PlainYearMonth.prototype%.</p>
      <p>This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.</p>
    </emu-clause>

    <emu-clause id="sec-temporal.plainyearmonth.from">
      <h1>Temporal.PlainYearMonth.from ( _item_ [ , _options_ ] )</h1>
      <p>
        The `from` method takes two arguments, _item_ and _options_.
        The following steps are taken:
      </p>
      <emu-alg>
        1. Set _options_ to ? GetOptionsObject(_options_).
        1. If Type(_item_) is Object and _item_ has an [[InitializedTemporalYearMonth]] internal slot, then
          1. Perform ? ToTemporalOverflow(_options_).
          1. Return ? CreateTemporalYearMonth(_item_.[[ISOYear]], _item_.[[ISOMonth]], _item_.[[Calendar]], _item_.[[ISODay]]).
        1. Return ? ToTemporalYearMonth(_item_, _options_).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.plainyearmonth.compare">
      <h1>Temporal.PlainYearMonth.compare ( _one_, _two_ )</h1>
      <p>
        The `compare` method takes two arguments, _one_ and _two_.
        The following steps are taken:
      </p>
      <emu-alg>
        1. Set _one_ to ? ToTemporalYearMonth(_one_).
        1. Set _two_ to ? ToTemporalYearMonth(_two_).
        1. Return 𝔽(! CompareISODate(_one_.[[ISOYear]], _one_.[[ISOMonth]], _one_.[[ISODay]], _two_.[[ISOYear]], _two_.[[ISOMonth]], _two_.[[ISODay]])).
      </emu-alg>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-properties-of-the-temporal-plainyearmonth-prototype-object">
    <h1>Properties of the Temporal.PlainYearMonth Prototype Object</h1>

    <p>The Temporal.PlainYearMonth prototype object</p>
    <ul>
      <li>is itself an ordinary object.</li>
      <li>is not a Temporal.PlainYearMonth instance and does not have a [[InitializedTemporalYearMonth]] internal slot.</li>
      <li>has a [[Prototype]] internal slot whose value is %Object.prototype%.</li>
    </ul>

    <emu-clause id="sec-temporal.plainyearmonth.prototype.constructor">
      <h1>Temporal.PlainYearMonth.prototype.constructor</h1>
      <p>The initial value of `Temporal.PlainYearMonth.prototype.constructor` is %Temporal.PlainYearMonth%.</p>
    </emu-clause>

    <emu-clause id="sec-temporal.plainyearmonth.prototype-@@tostringtag">
      <h1>Temporal.PlainYearMonth.prototype[ @@toStringTag ]</h1>
      <p>
        The initial value of the @@toStringTag property is the string value *"Temporal.PlainYearMonth"*.
      </p>
      <p>
        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
      </p>
    </emu-clause>

    <emu-clause id="sec-get-temporal.plainyearmonth.prototype.calendar">
      <h1>get Temporal.PlainYearMonth.prototype.calendar</h1>
      <p>
        `Temporal.PlainYearMonth.prototype.calendar` is an accessor property whose set accessor function is *undefined*.
        Its get accessor function performs the following steps:
      </p>
      <emu-alg>
        1. Let _plainYearMonth_ be the *this* value.
        1. Perform ? RequireInternalSlot(_plainYearMonth_, [[InitializedTemporalYearMonth]]).
        1. Return _plainYearMonth_.[[Calendar]].
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-temporal.plainyearmonth.prototype.year">
      <h1>get Temporal.PlainYearMonth.prototype.year</h1>
      <p>
        `Temporal.PlainYearMonth.prototype.year` is an accessor property whose set accessor function is *undefined*.
        Its get accessor function performs the following steps:
      </p>
      <emu-alg>
        1. Let _yearMonth_ be the *this* value.
        1. Perform ? RequireInternalSlot(_yearMonth_, [[InitializedTemporalYearMonth]]).
        1. Let _calendar_ be _yearMonth_.[[Calendar]].
        1. Return 𝔽(? CalendarYear(_calendar_, _yearMonth_)).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-temporal.plainyearmonth.prototype.month">
      <h1>get Temporal.PlainYearMonth.prototype.month</h1>
      <p>
        `Temporal.PlainYearMonth.prototype.month` is an accessor property whose set accessor function is *undefined*.
        Its get accessor function performs the following steps:
      </p>
      <emu-alg>
        1. Let _yearMonth_ be the *this* value.
        1. Perform ? RequireInternalSlot(_yearMonth_, [[InitializedTemporalYearMonth]]).
        1. Let _calendar_ be _yearMonth_.[[Calendar]].
        1. Return 𝔽(? CalendarMonth(_calendar_, _yearMonth_)).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-temporal.plainyearmonth.prototype.monthCode">
      <h1>get Temporal.PlainYearMonth.prototype.monthCode</h1>
      <p>
        `Temporal.PlainYearMonth.prototype.monthCode` is an accessor property whose set accessor function is *undefined*.
        Its get accessor function performs the following steps:
      </p>
      <emu-alg>
        1. Let _yearMonth_ be the *this* value.
        1. Perform ? RequireInternalSlot(_yearMonth_, [[InitializedTemporalYearMonth]]).
        1. Let _calendar_ be _yearMonth_.[[Calendar]].
        1. Return ? CalendarMonthCode(_calendar_, _yearMonth_).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-temporal.plainyearmonth.prototype.daysinyear">
      <h1>get Temporal.PlainYearMonth.prototype.daysInYear</h1>
      <p>
        `Temporal.PlainYearMonth.prototype.daysInYear` is an accessor property whose set accessor function is *undefined*.
        Its get accessor function performs the following steps:
      </p>
      <emu-alg>
        1. Let _yearMonth_ be the *this* value.
        1. Perform ? RequireInternalSlot(_yearMonth_, [[InitializedTemporalYearMonth]]).
        1. Let _calendar_ be _yearMonth_.[[Calendar]].
        1. Return ? CalendarDaysInYear(_calendar_, _yearMonth_).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-temporal.plainyearmonth.prototype.daysinmonth">
      <h1>get Temporal.PlainYearMonth.prototype.daysInMonth</h1>
      <p>
        `Temporal.PlainYearMonth.prototype.daysInMonth` is an accessor property whose set accessor function is *undefined*.
        Its get accessor function performs the following steps:
      </p>
      <emu-alg>
        1. Let _yearMonth_ be the *this* value.
        1. Perform ? RequireInternalSlot(_yearMonth_, [[InitializedTemporalYearMonth]]).
        1. Let _calendar_ be _yearMonth_.[[Calendar]].
        1. Return ? CalendarDaysInMonth(_calendar_, _yearMonth_).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-temporal.plainyearmonth.prototype.monthsinyear">
      <h1>get Temporal.PlainYearMonth.prototype.monthsInYear</h1>
      <p>
        `Temporal.PlainYearMonth.prototype.monthsInYear` is an accessor property whose set accessor function is *undefined*.
        Its get accessor function performs the following steps:
      </p>
      <emu-alg>
        1. Let _yearMonth_ be the *this* value.
        1. Perform ? RequireInternalSlot(_yearMonth_, [[InitializedTemporalYearMonth]]).
        1. Let _calendar_ be _yearMonth_.[[Calendar]].
        1. Return ? CalendarMonthsInYear(_calendar_, _yearMonth_).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-temporal.plainyearmonth.prototype.inleapyear">
      <h1>get Temporal.PlainYearMonth.prototype.inLeapYear</h1>
      <p>
        `Temporal.PlainYearMonth.prototype.inLeapYear` is an accessor property whose set accessor function is *undefined*.
        Its get accessor function performs the following steps:
      </p>
      <emu-alg>
        1. Let _yearMonth_ be the *this* value.
        1. Perform ? RequireInternalSlot(_yearMonth_, [[InitializedTemporalYearMonth]]).
        1. Let _calendar_ be _yearMonth_.[[Calendar]].
        1. Return ? CalendarInLeapYear(_calendar_, _yearMonth_).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.plainyearmonth.prototype.with">
      <h1>Temporal.PlainYearMonth.prototype.with ( _temporalYearMonthLike_ [ , _options_ ] )</h1>
      <p>
        The `with` method takes two arguments, _temporalYearMonthLike_ and _options_.
        The following steps are taken:
      </p>
      <emu-alg>
        1. Let _yearMonth_ be the *this* value.
        1. Perform ? RequireInternalSlot(_yearMonth_, [[InitializedTemporalYearMonth]]).
        1. If Type(_temporalYearMonthLike_) is not Object, then
          1. Throw a *TypeError* exception.
        1. Perform ? RejectTemporalCalendarType(_temporalYearMonthLike_).
        1. Let _calendarProperty_ be ? Get(_temporalYearMonthLike_, *"calendar"*).
        1. If _calendarProperty_ is not *undefined*, then
          1. Throw a *TypeError* exception.
        1. Let _timeZoneProperty_ be ? Get(_temporalYearMonthLike_, *"timeZone"*).
        1. If _timeZoneProperty_ is not *undefined*, then
          1. Throw a *TypeError* exception.
        1. Let _calendar_ be _yearMonth_.[[Calendar]].
        1. Let _fieldNames_ be ? CalendarFields(_calendar_, « *"month"*, *"monthCode"*, *"year"* »).
        1. Let _partialYearMonth_ be ? PreparePartialTemporalFields(_temporalYearMonthLike_, _fieldNames_).
        1. Set _options_ to ? GetOptionsObject(_options_).
        1. Let _fields_ be ? PrepareTemporalFields(_yearMonth_, _fieldNames_, «»).
        1. Set _fields_ to ? CalendarMergeFields(_calendar_, _fields_, _partialYearMonth_).
        1. Set _fields_ to ? PrepareTemporalFields(_fields_, _fieldNames_, «»).
        1. Return ? YearMonthFromFields(_calendar_, _fields_, _options_).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.plainyearmonth.prototype.add">
      <h1>Temporal.PlainYearMonth.prototype.add ( _temporalDurationLike_ [ , _options_ ] )</h1>
      <p>
        The `add` method takes two arguments, _temporalDurationLike_ and _options_.
        The following steps are taken:
      </p>
      <emu-alg>
        1. Let _yearMonth_ be the *this* value.
        1. Perform ? RequireInternalSlot(_yearMonth_, [[InitializedTemporalYearMonth]]).
        1. Let _duration_ be ? ToLimitedTemporalDuration(_temporalDurationLike_, « »).
        1. Let _balanceResult_ be ? BalanceDuration(_duration_.[[Days]], _duration_.[[Hours]], _duration_.[[Minutes]], _duration_.[[Seconds]], _duration_.[[Milliseconds]], _duration_.[[Microseconds]], _duration_.[[Nanoseconds]], *"day"*).
        1. Set _options_ to ? GetOptionsObject(_options_).
        1. Let _calendar_ be _yearMonth_.[[Calendar]].
        1. Let _fieldNames_ be ? CalendarFields(_calendar_, « *"monthCode"*, *"year"* »).
        1. Let _sign_ be ! DurationSign(_duration_.[[Years]], _duration_.[[Months]], _duration_.[[Weeks]], _balanceResult_.[[Days]], 0, 0, 0, 0, 0, 0).
        1. If _sign_ &lt; 0, then
          1. Let _day_ be ? CalendarDaysInMonth(_calendar_, _yearMonth_).
        1. Else,
          1. Let _day_ be 1.
        1. Let _date_ be ? CreateTemporalDate(_yearMonth_.[[ISOYear]], _yearMonth_.[[ISOMonth]], _day_, _calendar_).
        1. Let _durationToAdd_ be ? CreateTemporalDuration(_duration_.[[Years]], _duration_.[[Months]], _duration_.[[Weeks]], _balanceResult_.[[Days]], 0, 0, 0, 0, 0, 0).
        1. Let _addedDate_ be ? CalendarDateAdd(_calendar_, _date_, _durationToAdd_, _options_).
        1. Let _addedDateFields_ be ? PrepareTemporalFields(_addedDate_, _fieldNames_, «»).
        1. Return ? YearMonthFromFields(_calendar_, _addedDateFields_, _options_).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.plainyearmonth.prototype.subtract">
      <h1>Temporal.PlainYearMonth.prototype.subtract ( _temporalDurationLike_ [ , _options_ ] )</h1>
      <p>
        The `subtract` method takes two arguments, _temporalDurationLike_ and _options_.
        The following steps are taken:
      </p>
      <emu-alg>
        1. Let _yearMonth_ be the *this* value.
        1. Perform ? RequireInternalSlot(_yearMonth_, [[InitializedTemporalYearMonth]]).
        1. Let _duration_ be ? ToLimitedTemporalDuration(_temporalDurationLike_, « »).
        1. Let _balanceResult_ be ? BalanceDuration(_duration_.[[Days]], _duration_.[[Hours]], _duration_.[[Minutes]], _duration_.[[Seconds]], _duration_.[[Milliseconds]], _duration_.[[Microseconds]], _duration_.[[Nanoseconds]], *"day"*).
        1. Set _options_ to ? GetOptionsObject(_options_).
        1. Let _calendar_ be _yearMonth_.[[Calendar]].
        1. Let _fieldNames_ be ? CalendarFields(_calendar_, « *"monthCode"*, *"year"* »).
        1. Let _sign_ be ! DurationSign(_duration_.[[Years]], _duration_.[[Months]], _duration_.[[Weeks]], _balanceResult_.[[Days]], 0, 0, 0, 0, 0, 0).
        1. If _sign_ &lt; 0, then
          1. Let _day_ be ? CalendarDaysInMonth(_calendar_, _yearMonth_).
        1. Else,
          1. Let _day_ be 1.
        1. Let _date_ be ? CreateTemporalDate(_yearMonth_.[[ISOYear]], _yearMonth_.[[ISOMonth]], _day_, _calendar_).
        1. Let _durationToAdd_ be ? CreateTemporalDuration(−_duration_.[[Years]], −_duration_.[[Months]], −_duration_.[[Weeks]], −_balanceResult_.[[Days]], 0, 0, 0, 0, 0, 0).
        1. Let _addedDate_ be ? CalendarDateAdd(_calendar_, _date_, _durationToAdd_, _options_).
        1. Let _addedDateFields_ be ? PrepareTemporalFields(_addedDate_, _fieldNames_, «»).
        1. Return ? YearMonthFromFields(_calendar_, _addedDateFields_, _options_).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.plainyearmonth.prototype.until">
      <h1>Temporal.PlainYearMonth.prototype.until ( _other_ [ , _options_ ] )</h1>
      <p>
        The `until` method takes two arguments, _other_ and _options_.
        The following steps are taken:
      </p>
      <emu-alg>
        1. Let _yearMonth_ be the *this* value.
        1. Perform ? RequireInternalSlot(_yearMonth_, [[InitializedTemporalYearMonth]]).
        1. Set _other_ to ? ToTemporalYearMonth(_other_).
        1. Let _calendar_ be _yearMonth_.[[Calendar]].
        1. If ? CalendarEquals(_calendar_, _other_.[[Calendar]]) is *false*, throw a *RangeError* exception.
        1. Set _options_ to ? GetOptionsObject(_options_).
        1. Let _disallowedUnits_ be « *"week"*, *"day"*, *"hour"*, *"minute"*, *"second"*, *"millisecond"*, *"microsecond"*, *"nanosecond"* ».
        1. Let _smallestUnit_ be ? ToSmallestTemporalUnit(_options_, _disallowedUnits_, *"month"*).
        1. Let _largestUnit_ be ? ToLargestTemporalUnit(_options_, _disallowedUnits_, *"auto"*, *"year"*).
        1. Perform ? ValidateTemporalUnitRange(_largestUnit_, _smallestUnit_).
        1. Let _roundingMode_ be ? ToTemporalRoundingMode(_options_, *"trunc"*).
        1. Let _roundingIncrement_ be ? ToTemporalRoundingIncrement(_options_, *undefined*, *false*).
        1. Let _fieldNames_ be ? CalendarFields(_calendar_, « *"monthCode"*, *"year"* »).
        1. Let _otherFields_ be ? PrepareTemporalFields(_other_, _fieldNames_, «»).
        1. Perform ! CreateDataPropertyOrThrow(_otherFields_, *"day"*, *1*<sub>𝔽</sub>).
        1. Let _otherDate_ be ? DateFromFields(_calendar_, _otherFields_).
        1. Let _thisFields_ be ? PrepareTemporalFields(_yearMonth_, _fieldNames_, «»).
        1. Perform ! CreateDataPropertyOrThrow(_thisFields_, *"day"*, *1*<sub>𝔽</sub>).
        1. Let _thisDate_ be ? DateFromFields(_calendar_, _thisFields_).
        1. Let _untilOptions_ be ? MergeLargestUnitOption(_options_, _largestUnit_).
        1. Let _result_ be ? CalendarDateUntil(_calendar_, _thisDate_, _otherDate_, _untilOptions_).
        1. If _smallestUnit_ is *"month"* and _roundingIncrement_ = 1, then
          1. Return ? CreateTemporalDuration(_result_.[[Years]], _result_.[[Months]], 0, 0, 0, 0, 0, 0, 0, 0).
        1. Let _relativeTo_ be ? CreateTemporalDateTime(_thisDate_.[[ISOYear]], _thisDate_.[[ISOMonth]], _thisDate_.[[ISODay]], 0, 0, 0, 0, 0, 0, _calendar_).
        1. Let _result_ be ? RoundDuration(_result_.[[Years]], _result_.[[Months]], 0, 0, 0, 0, 0, 0, 0, 0, _roundingIncrement_, _smallestUnit_, _roundingMode_, _relativeTo_).
        1. Return ? CreateTemporalDuration(_result_.[[Years]], _result_.[[Months]], 0, 0, 0, 0, 0, 0, 0, 0).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.plainyearmonth.prototype.since">
      <h1>Temporal.PlainYearMonth.prototype.since ( _other_ [ , _options_ ] )</h1>
      <p>
        The `since` method takes two arguments, _other_ and _options_.
        The following steps are taken:
      </p>
      <emu-alg>
        1. Let _yearMonth_ be the *this* value.
        1. Perform ? RequireInternalSlot(_yearMonth_, [[InitializedTemporalYearMonth]]).
        1. Set _other_ to ? ToTemporalYearMonth(_other_).
        1. Let _calendar_ be _yearMonth_.[[Calendar]].
        1. If ? CalendarEquals(_calendar_, _other_.[[Calendar]]) is *false*, throw a *RangeError* exception.
        1. Set _options_ to ? GetOptionsObject(_options_).
        1. Let _disallowedUnits_ be « *"week"*, *"day"*, *"hour"*, *"minute"*, *"second"*, *"millisecond"*, *"microsecond"*, *"nanosecond"* ».
        1. Let _smallestUnit_ be ? ToSmallestTemporalUnit(_options_, _disallowedUnits_, *"month"*).
        1. Let _largestUnit_ be ? ToLargestTemporalUnit(_options_, _disallowedUnits_, *"auto"*, *"year"*).
        1. Perform ? ValidateTemporalUnitRange(_largestUnit_, _smallestUnit_).
        1. Let _roundingMode_ be ? ToTemporalRoundingMode(_options_, *"trunc"*).
        1. Set _roundingMode_ to ! NegateTemporalRoundingMode(_roundingMode_).
        1. Let _roundingIncrement_ be ? ToTemporalRoundingIncrement(_options_, *undefined*, *false*).
        1. Let _fieldNames_ be ? CalendarFields(_calendar_, « *"monthCode"*, *"year"* »).
        1. Let _otherFields_ be ? PrepareTemporalFields(_other_, _fieldNames_, «»).
        1. Perform ! CreateDataPropertyOrThrow(_otherFields_, *"day"*, *1*<sub>𝔽</sub>).
        1. Let _otherDate_ be ? DateFromFields(_calendar_, _otherFields_).
        1. Let _thisFields_ be ? PrepareTemporalFields(_yearMonth_, _fieldNames_, «»).
        1. Perform ! CreateDataPropertyOrThrow(_thisFields_, *"day"*, *1*<sub>𝔽</sub>).
        1. Let _thisDate_ be ? DateFromFields(_calendar_, _thisFields_).
        1. Let _untilOptions_ be ? MergeLargestUnitOption(_options_, _largestUnit_).
        1. Let _result_ be ? CalendarDateUntil(_calendar_, _thisDate_, _otherDate_, _untilOptions_).
        1. If _smallestUnit_ is *"month"* and _roundingIncrement_ = 1, then
          1. Return ? CreateTemporalDuration(−_result_.[[Years]], −_result_.[[Months]], 0, 0, 0, 0, 0, 0, 0, 0).
        1. Let _relativeTo_ be ? CreateTemporalDateTime(_thisDate_.[[ISOYear]], _thisDate_.[[ISOMonth]], _thisDate_.[[ISODay]], 0, 0, 0, 0, 0, 0, _calendar_).
        1. Set _roundingMode_ to ! NegateTemporalRoundingMode(_roundingMode_).
        1. Let _result_ be ? RoundDuration(_result_.[[Years]], _result_.[[Months]], 0, 0, 0, 0, 0, 0, 0, 0, _roundingIncrement_, _smallestUnit_, _roundingMode_, _relativeTo_).
        1. Return ? CreateTemporalDuration(−_result_.[[Years]], −_result_.[[Months]], 0, 0, 0, 0, 0, 0, 0, 0).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.plainyearmonth.prototype.equals">
      <h1>Temporal.PlainYearMonth.prototype.equals ( _other_ )</h1>
      <p>
        The `equals` method takes one argument _other_.
        The following steps are taken:
      </p>
      <emu-alg>
        1. Let _yearMonth_ be the *this* value.
        1. Perform ? RequireInternalSlot(_yearMonth_, [[InitializedTemporalYearMonth]]).
        1. Set _other_ to ? ToTemporalYearMonth(_other_).
        1. If _yearMonth_.[[ISOYear]] ≠ _other_.[[ISOYear]], return *false*.
        1. If _yearMonth_.[[ISOMonth]] ≠ _other_.[[ISOMonth]], return *false*.
        1. If _yearMonth_.[[ISODay]] ≠ _other_.[[ISODay]], return *false*.
        1. Return ? CalendarEquals(_yearMonth_.[[Calendar]], _other_.[[Calendar]]).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.plainyearmonth.prototype.tostring">
      <h1>Temporal.PlainYearMonth.prototype.toString ( [ _options_ ] )</h1>
      <p>
        The `toString` method takes one argument _options_.
        The following steps are taken:
      </p>
      <emu-alg>
        1. Let _yearMonth_ be the *this* value.
        1. Perform ? RequireInternalSlot(_yearMonth_, [[InitializedTemporalYearMonth]]).
        1. Set _options_ to ? GetOptionsObject(_options_).
        1. Let _showCalendar_ be ? ToShowCalendarOption(_options_).
        1. Return ? TemporalYearMonthToString(_yearMonth_, _showCalendar_).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.plainyearmonth.prototype.tolocalestring">
      <h1>Temporal.PlainYearMonth.prototype.toLocaleString ( [ _locales_ [ , _options_ ] ] )</h1>
      <p>
        An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement the `Temporal.PlainYearMonth.prototype.toLocaleString` method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of the `toLocaleString` method is used.
      </p>
      <p>
        The `toLocaleString` method takes two arguments, _locales_ and _options_.
        The following steps are taken:
      </p>
      <emu-alg>
        1. Let _yearMonth_ be the *this* value.
        1. Perform ? RequireInternalSlot(_yearMonth_, [[InitializedTemporalYearMonth]]).
        1. Return ? TemporalYearMonthToString(_yearMonth_, *"auto"*).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.plainyearmonth.prototype.tojson">
      <h1>Temporal.PlainYearMonth.prototype.toJSON ( )</h1>
      <p>
        The following steps are taken:
      </p>
      <emu-alg>
        1. Let _yearMonth_ be the *this* value.
        1. Perform ? RequireInternalSlot(_yearMonth_, [[InitializedTemporalYearMonth]]).
        1. Return ? TemporalYearMonthToString(_yearMonth_, *"auto"*).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.plainyearmonth.prototype.valueof">
      <h1>Temporal.PlainYearMonth.prototype.valueOf ( )</h1>
      <p>
        The following steps are taken:
      </p>
      <emu-alg>
        1. Throw a *TypeError* exception.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.plainyearmonth.prototype.toplaindate">
      <h1>Temporal.PlainYearMonth.prototype.toPlainDate ( _item_ )</h1>
      <p>
        The `toPlainDate` method takes one argument _item_.
        The following steps are taken:
      </p>
      <emu-alg>
        1. Let _yearMonth_ be the *this* value.
        1. Perform ? RequireInternalSlot(_yearMonth_, [[InitializedTemporalYearMonth]]).
        1. If Type(_item_) is not Object, then
          1. Throw a *TypeError* exception.
        1. Let _calendar_ be _yearMonth_.[[Calendar]].
        1. Let _receiverFieldNames_ be ? CalendarFields(_calendar_, « *"monthCode"*, *"year"* »).
        1. Let _fields_ be ? PrepareTemporalFields(_yearMonth_, _receiverFieldNames_, «»).
        1. Let _inputFieldNames_ be ? CalendarFields(_calendar_, « *"day"* »).
        1. Let _inputFields_ be ? PrepareTemporalFields(_item_, _inputFieldNames_, «»).
        1. Let _mergedFields_ be ? CalendarMergeFields(_calendar_, _fields_, _inputFields_).
        1. Let _mergedFieldNames_ be the List containing all the elements of _receiverFieldNames_ followed by all the elements of _inputFieldNames_, with duplicate elements removed.
        1. Set _mergedFields_ to ? PrepareTemporalFields(_mergedFields_, _mergedFieldNames_, «»).
        1. Let _options_ be ! OrdinaryObjectCreate(*null*).
        1. Perform ! CreateDataPropertyOrThrow(_options_, *"overflow"*, *"reject"*).
        1. Return ? DateFromFields(_calendar_, _mergedFields_, _options_).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.plainyearmonth.prototype.getisofields">
      <h1>Temporal.PlainYearMonth.prototype.getISOFields ( )</h1>
      <p>
        The following steps are taken:
      </p>
      <emu-alg>
        1. Let _yearMonth_ be the *this* value.
        1. Perform ? RequireInternalSlot(_yearMonth_, [[InitializedTemporalYearMonth]]).
        1. Let _fields_ be ! OrdinaryObjectCreate(%Object.prototype%).
        1. Perform ! CreateDataPropertyOrThrow(_fields_, *"calendar"*, _yearMonth_.[[Calendar]]).
        1. Perform ! CreateDataPropertyOrThrow(_fields_, *"isoDay"*, 𝔽(_yearMonth_.[[ISODay]])).
        1. Perform ! CreateDataPropertyOrThrow(_fields_, *"isoMonth"*, 𝔽(_yearMonth_.[[ISOMonth]])).
        1. Perform ! CreateDataPropertyOrThrow(_fields_, *"isoYear"*, 𝔽(_yearMonth_.[[ISOYear]])).
        1. Return _fields_.
      </emu-alg>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-properties-of-temporal-plainyearmonth-instances">
    <h1>Properties of Temporal.PlainYearMonth Instances</h1>
    <p>
      Temporal.PlainYearMonth instances are ordinary objects that inherit properties from the %Temporal.PlainYearMonth.prototype% intrinsic object.
      Temporal.PlainYearMonth instances are initially created with the internal slots described in <emu-xref href="#table-internal-slots-of-temporalyearmonth-instances"></emu-xref>.
    </p>
    <emu-table id="table-internal-slots-of-temporalyearmonth-instances" caption="Internal Slots of Temporal.PlainYearMonth Instances">
      <table>
        <tbody>
          <tr>
            <th>
              Internal Slot
            </th>
            <th>
              Description
            </th>
          </tr>
          <tr>
            <td>
              [[InitializedTemporalYearMonth]]
            </td>
            <td>
              The only specified use of this slot is for distinguishing Temporal.PlainYearMonth instances from other objects.
            </td>
          </tr>
          <tr>
            <td>
              [[ISOYear]]
            </td>
            <td>
              An integer representing the year in the ISO 8601 calendar.
            </td>
          </tr>
          <tr>
            <td>
              [[ISOMonth]]
            </td>
            <td>
              An integer between 1 and 12, inclusive, representing the month of the year in the ISO 8601 calendar.
            </td>
          </tr>
          <tr>
            <td>
              [[ISODay]]
            </td>
            <td>
              An integer between 1 and ISODaysInMonth([[ISOYear]], [[ISOMonth]]), inclusive, representing a reference day of the month in the ISO 8601 calendar.
              This slot is used by the calendar object in the [[Calendar]] slot to disambiguate if the [[ISOYear]] and [[ISOMonth]] slots are not enough to uniquely identify a year and month in that calendar.
            </td>
          </tr>
          <tr>
            <td>
              [[Calendar]]
            </td>
            <td>
              An Object representing the calendar.
            </td>
          </tr>
        </tbody>
      </table>
    </emu-table>
  </emu-clause>

  <emu-clause id="sec-temporal-plainyearmonth-abstract-ops">
    <h1>Abstract operations</h1>

    <emu-clause id="sec-temporal-totemporalyearmonth" aoid="ToTemporalYearMonth">
      <h1>ToTemporalYearMonth ( _item_ [ , _options_ ] )</h1>
      <p>
        The abstract operation ToTemporalYearMonth returns its argument _item_ if it is already a Temporal.PlainYearMonth instance, converts _item_ to a new Temporal.PlainYearMonth instance if possible, and throws otherwise.
      </p>
      <emu-alg>
        1. If _options_ is not present, set _options_ to ! OrdinaryObjectCreate(*null*).
        1. Assert: Type(_options_) is Object.
        1. If Type(_item_) is Object, then
          1. If _item_ has an [[InitializedTemporalYearMonth]] internal slot, then
            1. Return _item_.
          1. Let _calendar_ be ? GetTemporalCalendarWithISODefault(_item_).
          1. Let _fieldNames_ be ? CalendarFields(_calendar_, « *"month"*, *"monthCode"*, *"year"* »).
          1. Let _fields_ be ? PrepareTemporalFields(_item_, _fieldNames_, «»).
          1. Return ? YearMonthFromFields(_calendar_, _fields_, _options_).
        1. Perform ? ToTemporalOverflow(_options_).
        1. Let _string_ be ? ToString(_item_).
        1. Let _result_ be ? ParseTemporalYearMonthString(_string_).
        1. Let _calendar_ be ? ToTemporalCalendarWithISODefault(_result_.[[Calendar]]).
        1. Set _result_ to ? CreateTemporalYearMonth(_result_.[[Year]], _result_.[[Month]], _calendar_, _result_.[[Day]]).
        1. Let _canonicalYearMonthOptions_ be ! OrdinaryObjectCreate(*null*).
        1. Return ? YearMonthFromFields(_calendar_, _result_, _canonicalYearMonthOptions_).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-regulateisoyearmonth" aoid="RegulateISOYearMonth">
      <h1>RegulateISOYearMonth ( _year_, _month_, _overflow_ )</h1>
      <emu-alg>
        1. Assert: _year_ and _month_ are integers.
        1. Assert: _overflow_ is either *"constrain"* or *"reject"*.
        1. If _overflow_ is *"constrain"*, then
          1. Return ! ConstrainISOYearMonth(_year_, _month_).
        1. If _overflow_ is *"reject"*, then
          1. If ! IsValidISOMonth(_month_) is *false*, throw a *RangeError* exception.
          1. Return the new Record {
              [[Year]]: _year_,
              [[Month]]: _month_
            }.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-isvalidisomonth" aoid="IsValidISOMonth">
      <h1>IsValidISOMonth ( _month_ )</h1>
      <p>
        The abstract operation IsValidISOMonth returns *true* if its argument is a valid month in the ISO 8601 calendar, and *false* otherwise.
      </p>
      <emu-alg>
        1. Assert: _month_ is an integer.
        1. If _month_ &lt; 1 or _month_ &gt; 12, then
          1. Return *false*.
        1. Return *true*.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-isoyearmonthwithinlimits" aoid="ISOYearMonthWithinLimits">
      <h1>ISOYearMonthWithinLimits ( _year_, _month_ )</h1>
      <p>
        The abstract operation ISOYearMonthWithinLimits returns *true* if its arguments represent a month within the range that a Temporal.PlainYearMonth object can represent, and *false* otherwise.
      </p>
      <emu-note>
        <p>
          Temporal.PlainYearMonth objects can represent any month that contains a day that a Temporal.PlainDate can represent.
          This ensures that a Temporal.PlainDate object can always be converted into a Temporal.PlainYearMonth object.
        </p>
      </emu-note>
      <emu-alg>
        1. Assert: _year_ and _month_ are integers.
        1. If _year_ &lt; −271821 or _year_ &gt; 275760, then
          1. Return *false*.
        1. If _year_ is −271821 and _month_ &lt; 4, then
          1. Return *false*.
        1. If _year_ is 275760 and _month_ &gt; 9, then
          1. Return *false*.
        1. Return *true*.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-balanceisoyearmonth" aoid="BalanceISOYearMonth">
      <h1>BalanceISOYearMonth ( _year_, _month_ )</h1>
      <emu-alg>
        1. Assert: _year_ and _month_ are integers.
        1. Set _year_ to _year_ + floor((_month_ - 1) / 12).
        1. Set _month_ to (_month_ − 1) modulo 12 + 1.
        1. Return the new Record {
            [[Year]]: _year_,
            [[Month]]: _month_
          }.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-constrainisoyearmonth" aoid="ConstrainISOYearMonth">
      <h1>ConstrainISOYearMonth ( _year_, _month_ )</h1>
      <emu-alg>
        1. Assert: _year_ and _month_ are integers.
        1. Set _month_ to ! ConstrainToRange(_month_, 1, 12).
        1. Return the Record {
          [[Year]]: _year_,
          [[Month]]: _month_
          }.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-createtemporalyearmonth" aoid="CreateTemporalYearMonth">
      <h1>CreateTemporalYearMonth ( _isoYear_, _isoMonth_, _calendar_, _referenceISODay_ [ , _newTarget_ ] )</h1>
      <emu-alg>
        1. Assert: _isoYear_, _isoMonth_, and _referenceISODay_ are integers.
        1. Assert: Type(_calendar_) is Object.
        1. If ! IsValidISODate(_isoYear_, _isoMonth_, _referenceISODay_) is *false*, throw a *RangeError* exception.
        1. If ! ISOYearMonthWithinLimits(_isoYear_, _isoMonth_) is *false*, throw a *RangeError* exception.
        1. If _newTarget_ is not present, set it to %Temporal.PlainYearMonth%.
        1. Let _object_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%Temporal.PlainYearMonth.prototype%"*, « [[InitializedTemporalYearMonth]], [[ISOYear]], [[ISOMonth]], [[ISODay]], [[Calendar]] »).
        1. Set _object_.[[ISOYear]] to _isoYear_.
        1. Set _object_.[[ISOMonth]] to _isoMonth_.
        1. Set _object_.[[Calendar]] to _calendar_.
        1. Set _object_.[[ISODay]] to _referenceISODay_.
        1. Return _object_.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-temporalyearmonthtostring" aoid="TemporalYearMonthToString">
      <h1>TemporalYearMonthToString ( _yearMonth_, _showCalendar_ )</h1>
      <emu-alg>
        1. Assert: Type(_yearMonth_) is Object.
        1. Assert: _yearMonth_ has an [[InitializedTemporalYearMonth]] internal slot.
        1. Let _year_ be ! PadISOYear(_yearMonth_.[[ISOYear]]).
        1. Let _month_ be _yearMonth_.[[ISOMonth]] formatted as a two-digit decimal number, padded to the left with a zero if necessary.
        1. Let _result_ be the string-concatenation of _year_, the code unit 0x002D (HYPHEN-MINUS), and _month_.
        1. Let _calendarID_ be ? ToString(_yearMonth_.[[Calendar]]).
        1. If _calendarID_ is not *"iso8601"*, then
          1. Let _day_ be _yearMonth_.[[ISODay]] formatted as a two-digit decimal number, padded to the left with a zero if necessary.
          1. Set _result_ to the string-concatenation of _result_, the code unit 0x002D (HYPHEN-MINUS), and _day_.
        1. Let _calendarString_ be ! FormatCalendarAnnotation(_calendarID_, _showCalendar_).
        1. Set _result_ to the string-concatenation of _result_ and _calendarString_.
        1. Return _result_.
      </emu-alg>
    </emu-clause>
  </emu-clause>
</emu-clause>
